/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIComponents.weeklyComponents;

import MainClasses.*;
import java.util.*;
import GUIComponents.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import javax.swing.*;
/**
 *
 * @author andrewcutler
 */
public class WeeklyClassPanel extends JPanel{
    
    public ArrayList<GUIComponents.DayPanel> days;
    public Course course;
    public JPanel panel;
    
    public WeeklyClassPanel(Course c)
    {
        course = c;
        
        this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
        this.add(new WeeklyClassHeader());
        
        days = new ArrayList<GUIComponents.DayPanel> ();
        
        panel = new WeeklyClassBody();
        this.add(panel);
        
        
    }
    
    public void reset()
    {
        
    }
    
    private class WeeklyClassBody extends JPanel{
        
        public WeeklyClassBody()
        {
            this.setLayout(new GridLayout(1,7));
            
            for(int i = 0; i < 7; i++)
            {
                GUIComponents.DayPanel current = new GUIComponents.DayPanel(main.getCurrentDate(i), course);
                days.add(current);
                this.add(current);
            }
        }
    }
    
    private class WeeklyClassHeader extends JPanel{
        
        public WeeklyClassHeader()
        {
            this.setPreferredSize(new Dimension(400, 25));
            this.setBorder(BorderFactory.createLineBorder(Color.black));
            this.add(new JLabel(course.getPeriodName() + " - " + course.getCourseName()));
        }
    }

}
